Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Maven Archetype for creating new Trino plugins #12929

Closed
wants to merge 2 commits into from

Conversation

nineinchnick
Copy link
Member

Description

Add a Maven Archetype to make it easier to create new Trino plugins. It creates a new plugin with a connector that has a single table with 3 columns, and it returns a single row with constant values. It includes integration tests that actually create a new project and run its (integration) tests.

The archetype is created during the build from an actual plugin. There's a new plugin that is not under the Trino project root, assuming new plugins created using this archetype would not be submitted to the Trino project.

A previous attempt is in #12605

Is this change a fix, improvement, new feature, refactoring, or other?
new feature

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)
plugins

How would you describe this change to a non-technical end user or system administrator?
The Maven Archetype makes it easier to create a new Trino plugin from scratch

Related issues, pull requests, and links

Documentation

( ) No documentation is needed.
(x) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required.
( ) Release notes entries required with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Jun 22, 2022
@github-actions github-actions bot added the docs label Jun 22, 2022
@nineinchnick
Copy link
Member Author

@martint PTAL and note I added another plugin example that's not using the io.trino group on purpose. It should not be "deployed" during a release, but we probably want it to be built with all other modules. WDYT?

@nineinchnick nineinchnick force-pushed the plugin-archetype branch 2 times, most recently from 27f9fc5 to d854a76 Compare June 24, 2022 08:46
@nineinchnick nineinchnick added the no-release-notes This pull request does not require release notes entry label Jun 24, 2022
@nineinchnick nineinchnick requested review from hashhar and martint July 7, 2022 12:32
@nineinchnick
Copy link
Member Author

@martint PTAL. I added a fixup commit to show what it takes to update this to the latest version. Your idea with a regular project worked great, there was one deprecated arg removed and I was able to fix that easily.

@electrum
Copy link
Member

I like this approach, since the plugin is a normal plugin module that gets built and tested as usual. Can you split the commits so that the example plugin is added first? That will make it easier to review and see the archtype bits.

@nineinchnick nineinchnick force-pushed the plugin-archetype branch 2 times, most recently from cb237f7 to 5eb4fd2 Compare July 27, 2022 16:16
@nineinchnick
Copy link
Member Author

@electrum I split the commits, @martint the new example plugin shouldn't get published now, PTAL

plugin/trino-example-plugin/pom.xml Outdated Show resolved Hide resolved
plugin/trino-example-plugin/pom.xml Outdated Show resolved Hide resolved
plugin/trino-example-plugin/pom.xml Outdated Show resolved Hide resolved
plugin/trino-example-plugin/pom.xml Outdated Show resolved Hide resolved
plugin/trino-example-plugin/pom.xml Outdated Show resolved Hide resolved
@nineinchnick nineinchnick force-pushed the plugin-archetype branch 2 times, most recently from 7198d37 to 89e52c3 Compare November 10, 2022 18:43
@nineinchnick
Copy link
Member Author

@martint I mentioned this PR when we last talked in Warsaw, PTAL.

@nineinchnick nineinchnick force-pushed the plugin-archetype branch 5 times, most recently from c43d3cb to daa80d5 Compare March 8, 2023 09:44
@nineinchnick nineinchnick force-pushed the plugin-archetype branch 4 times, most recently from 1af2e97 to 7f7ceab Compare March 11, 2023 09:01
@nineinchnick
Copy link
Member Author

I'm having huge issues with running this in offline mode. Looks like org.apache.maven.plugins:maven-archetype-plugin:3.2.1:create-from-project has goals defined without plugin versions (maybe here?) and doesn't use the default Maven versions (like Maven does when you run it in a dir without any POM). It fails to resolve the version of the install plugin even though we're not executing this phase (-Darchetype.postPhase=validate).

I give up. We either have to:

  • disable offline mode
  • avoid using create-from-project or write a custom tool
  • fix this upstream, but I'm not even sure what's the root cause

@nineinchnick nineinchnick force-pushed the plugin-archetype branch 2 times, most recently from 72c4c03 to 0fd0111 Compare February 20, 2024 15:29
@nineinchnick
Copy link
Member Author

@electrum PTAL again, I just rebased it

@nineinchnick
Copy link
Member Author

Looks like there's no interest in this anymore.

@nineinchnick nineinchnick deleted the plugin-archetype branch May 27, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed docs no-release-notes This pull request does not require release notes entry
Development

Successfully merging this pull request may close these issues.

3 participants